<?php

namespace App\Http\Requests\Backend;

use Illuminate\Foundation\Http\FormRequest;

class AboutMeRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'name' => 'required',
            'avatar' => 'required',
            'gender' => 'required',
            'age' => 'required',
            'content' => 'required',
        ];
    }

    public function messages()
    {
        return [
            'id.required' => '主键不能为空！',
            'name.required' => '请输入名称！',
            'avatar.required' => '请上传头像！',
            'gender.required' => '请选择性别！',
            'age.required' => '请输入年龄！',
            'content.required' => '请输入介绍内容！',
        ];
    }
}
